﻿using IBll;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Model;

namespace WebAPi522.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class EmpController : ControllerBase, IUserBll
    {
        IUserBll bll;
        public EmpController(IUserBll bll)
        {
            this.bll = bll;
        }
        [HttpPost]
        public int AddUser(UsrInfo usrInfo)
        {
            try
            {
                return bll.AddUser(usrInfo);
            }
            catch(Exception ex)
            {
                throw;
            }
        }
        [HttpGet]
        public int Login(string name, string pwd)
        {
            try
            {
                return bll.Login(name, pwd);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
    }
}
